class ChangeSpaceFixToSpType < ActiveRecord::Migration
  def self.up
    space_fix_type = SpType.create! :name =>'娱乐版tudou和youku的0.5修正', :code => "tudou and youku"
    WeeklyResult.transaction do
     WeeklyResult.find_all_by_is_space_fix(true).each{|wr| wr.update_attribute :sp_type_id, space_fix_type.id}
    end
  end

  def self.down
  end
end
